import React, { Component } from 'react';

/*
start_time=2019-02-15 00:00:00
end_time=2019-02-22 23:59:59
reply_status=-1           -1全部 0未回复 1已回复
level=-1                  -1全部 1差评(1-2星) 2中评(3星) 3好评(4-5星)
nonempty                  全部不传此参数 1有内容 0无内容
page_num=1                页码
page_count=20             个数
shop_id                   门店id, 全部不传此参数
supplier_id: 2233065879   全部的时候此参数会替代shop_id
*/

class EB extends Component {
  constructor (...args) {
    super(...args);

  }
  async componentDidMount () {
    document.cookie = 'WMSTOKEN=OQOAAAILVQGEyh2VXc_JQxJZmxhNysxEyhefFUqZTsxDWLcAAC8t5R3-0AAARtFBFBGSRoEHhg5F6CCM_ylg9uawAAUnNLF2_CERSDAQAApRGpGdSo1RpmZyYdygBQAA';
    document.cookie = 'WMUSS=B0AAGgCAABoeRQ3Dh1rclVYZRE5BgYwRGM7B1teT34HEhhvGGBNAVphN2h-IltUeUBkYmdwAAMkZqYgtNHhEpfF8nA3E%7EcQogPwp5IUFhH2I9clx8Vw9DQXFNDw9eNww-Xg4wHX85PD9DNl8EF35mVHFCUEhQFApBYBlQ5DFRB99nxQ33YwUPb0ADAM8Avhy';
    let json = {
      start_time: '2019-01-01 00:00:00',
      end_time: '2019-03-01 23:59:59',
      // reply_status: -1,
      // level: -1,
      page_num: 2,
      page_count: 100
    }
    let arr = [];
    for (let attr in json) {
      arr.push(`${attr}=${json[attr]}`);
    }
    let res = await fetch('eb/getelecommentlist?' + arr.join('&'));
    let {data} = await res.json();
    console.log(data);
  }

  render() {
    return (
      <div>
        ebai
      </div>
    );
  }

}

export default EB;

// https://be.ele.me/crm/getelecommentlist?start_time=2019-02-15 00:00:00&end_time=2019-02-22 23:59:59&reply_status=-1&level=3&page_num=1&page_count=20&supplier_id=2233065879

// WMSTOKEN
// OQOAAAILVQGEyh2VXc_JQxJZmxhNysxEyhefFUqZTsxDWLcAAC8t5R3-0AAARtFBFBGSRoEHhg5F6CCM_ylg9uawAAUnNLF2_CERSDAQAApRGpGdSo1RpmZyYdygBQAA

// WMUSS
// B0AAGgCAABoeRQ3Dh1rclVYZRE5BgYwRGM7B1teT34HEhhvGGBNAVphN2h-IltUeUBkYmdwAAMkZqYgtNHhEpfF8nA3E%7EcQogPwp5IUFhH2I9clx8Vw9DQXFNDw9eNww-Xg4wHX85PD9DNl8EF35mVHFCUEhQFApBYBlQ5DFRB99nxQ33YwUPb0ADAM8Avhy
